package com.lhd.dao;

import com.lhd.po.Tag;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by liuhandong on 2021/10/27.
 */
@Service
public interface TagDao{

    Tag findByName(@Param("name") String name);

    Integer save(Tag tag);

    Tag findOne(Long id);

    List<Tag> findAllByPage(Integer page);

    List<Tag> topSeven();

    List<Tag> findAll();

    Long delete(Long id);

    Long deleteBlogTags(Long id);

    Integer countTag();

    List<Tag> listTagByPage(Long page);

    Integer update(Map<String, Object> map);

    Long getMaxId();

    void insertBlogIdAndTagId(@Param("blogId") Long blogId, @Param("tagId") Long tagId);

    void clearBlogIdAndTagId(Long blogId);

    Long getCountByTagId(Long tagId);

    List<Tag> listTagTop(Integer i);

    List<Integer> getTagIdsByBlogId(Integer blogId);
}
